package com.snail.controller;

import com.snail.common.DeleteRequest;
import com.snail.model.dto.CourseCategoryIndexDto;
import com.snail.model.dto.CourseCategoryTreeDto;
import com.snail.model.pojo.BizCourseCategory;
import com.snail.response.BaseResponse;
import com.snail.service.BizCourseCategoryService;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @author Monica
 * @description
 * @date 2025/7/17 22:44
 */
@RestController
@RequestMapping("/courseCategory")
@AllArgsConstructor
public class BizCourseCategoryController {

    private final BizCourseCategoryService bizCourseCategoryService;

    @GetMapping("/getCourseCategoryTree")
    public BaseResponse<List<CourseCategoryTreeDto>> getCourseCategoryTree() {
        return bizCourseCategoryService.getCourseCategoryTree();
    }

    @PostMapping("/addCourseCategory")
    public BaseResponse addCourseCategory(@RequestBody BizCourseCategory bizCourseCategory) {
        return bizCourseCategoryService.addCourseCategory(bizCourseCategory);
    }

    @PostMapping("/updateCourseCategory")
    public BaseResponse updateCourseCategory(@RequestBody BizCourseCategory bizCourseCategory) {
        return bizCourseCategoryService.updateCourseCategory(bizCourseCategory);
    }


    @PostMapping("/deleteCourseCategory")
    public BaseResponse deleteCourseCategory(@RequestBody DeleteRequest deleteRequest) {
        return bizCourseCategoryService.deleteCourseCategory(deleteRequest);
    }


    @GetMapping("/getCourseCategoryIndex")
    public BaseResponse<List<CourseCategoryIndexDto>> getCourseCategoryIndex() {
        return bizCourseCategoryService.getCourseCategoryIndex();
    }

}
